//
//  UIButton+Chained.m
//  ObjectCChained
//
//  Created by sny on 2018/5/16.
//  Copyright © 2018年 HuangYangYang. All rights reserved.
//

#import "UIButton+Chained.h"

@implementation UIButton (Chained)

#pragma mark - getter方法

- (UIButton *(^)(NSString *,CGFloat ,UIColor *))titleParams {
    return ^UIButton *(NSString *title,CGFloat fountSize,UIColor *textColor){
        if (title) {[self setTitle:title forState:UIControlStateNormal];}
        if (fountSize) {[self.titleLabel setFont:[UIFont systemFontOfSize:fountSize]];}
        if (textColor) {[self.titleLabel setTextColor:textColor];}
        return self;
    };
}

- (UIButton *(^)(UIImage *,UIImage *))selectImageParams {
    return ^UIButton *(UIImage *selectImage,UIImage *normalImage) {
        if (selectImage) {[self setImage:selectImage forState:UIControlStateSelected];}
        if (normalImage) {[self setImage:normalImage forState:UIControlStateNormal];}
        return self;
    };
}

- (UIButton *(^)(UIEdgeInsets))titleEdgeInsetsParams {
    return ^UIButton *(UIEdgeInsets titleEdgeInsets) {
       [self setTitleEdgeInsets:titleEdgeInsets];
        return self;
    };
}

- (UIButton *(^)(UIEdgeInsets))imageEdgeInsetsParams {
    return ^UIButton *(UIEdgeInsets imageEdgeInsets) {
        [self setImageEdgeInsets:imageEdgeInsets];
        return self;
    };
}

#pragma mark - setter
- (void)setTitleParams:(UIButton *(^)(NSString *, CGFloat, UIColor *))titleParams {
    
}

- (void)setSelectImageParams:(UIButton *(^)(UIImage *, UIImage *))selectImageParams {
    
}

- (void)setTitleEdgeInsetsParams:(UIButton *(^)(UIEdgeInsets))titleEdgeInsets {
    
}

- (void)setImageEdgeInsetsParams:(UIButton *(^)(UIEdgeInsets))imageEdgeInsets {
    
}

@end
